home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #2 / Ham Radio 2000 - Volume 2.iso / HAMV2 / TCP_IP / TNOS230S / PKTDRVR.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-07-30  |  3.1 KB  |  112 lines

  1. #ifndef    _PKTDRVR_H
  2. #define    _PKTDRVR_H
  3.  
  4. #if defined(MSDOS) && !defined(__dj_include_dpmi_h_)
  5. #include <dpmi.h>
  6. #endif
  7.  
  8. #ifndef    _MBUF_H
  9. #include "mbuf.h"
  10. #endif
  11.  
  12. #ifndef    _IFACE_H
  13. #include "iface.h"
  14. #endif
  15.  
  16. #define    PK_MAX    3
  17.  
  18. /* Packet driver interface classes */
  19. #define    CL_NONE        0
  20. #define    CL_ETHERNET    1
  21. #define    CL_PRONET_10    2
  22. #define    CL_IEEE8025    3
  23. #define    CL_OMNINET    4
  24. #define    CL_APPLETALK    5
  25. #define    CL_SERIAL_LINE    6
  26. #define    CL_STARLAN    7
  27. #define    CL_ARCNET    8
  28. #define    CL_AX25        9
  29. #define    CL_KISS        10
  30. #define CL_IEEE8023    11
  31. #define CL_FDDI     12
  32. #define CL_INTERNET_X25 13
  33. #define CL_LANSTAR    14
  34. #define CL_SLFP     15
  35. #define    CL_NETROM    16
  36. #define CL_PPP        17
  37. #define    CL_QTSO        18
  38. #define NCLASS        19
  39.  
  40. #ifdef    MSDOS
  41.  
  42. /* Packet driver interface types (not a complete list) */
  43. #define    TC500        1
  44. #define    PC2000        10
  45. #define    WD8003        14
  46. #define    PC8250        15
  47. #define    ANYTYPE        0xffff
  48.  
  49. /* Packet driver function call numbers. From Appendix B. */
  50. #define    DRIVER_INFO        1
  51. #define    ACCESS_TYPE        2
  52. #define    RELEASE_TYPE        3
  53. #define    SEND_PKT        4
  54. #define    TERMINATE        5
  55. #define    GET_ADDRESS        6
  56. #define    RESET_INTERFACE        7
  57. #define GET_PARAMETERS        10
  58. #define AS_SEND_PKT        11
  59. #define    SET_RCV_MODE        20
  60. #define    GET_RCV_MODE        21
  61. #define    SET_MULTICAST_LIST    22
  62. #define    GET_MULTICAST_LIST    23
  63. #define    GET_STATISTICS        24
  64. #define SET_ADDRESS        25
  65.  
  66. /* Packet driver error return codes. From Appendix C. */
  67.  
  68. #ifndef NO_ERROR
  69. #define    NO_ERROR    0
  70. #endif
  71. #define    BAD_HANDLE    1    /* invalid handle number */
  72. #define    NO_CLASS    2    /* no interfaces of specified class found */
  73. #define    NO_TYPE        3    /* no interfaces of specified type found */
  74. #define    NO_NUMBER    4    /* no interfaces of specified number found */
  75. #define    BAD_TYPE    5    /* bad packet type specified */
  76. #define    NO_MULTICAST    6    /* this interface does not support multicast */
  77. #define    CANT_TERMINATE    7    /* this packet driver cannot terminate */
  78. #define    BAD_MODE    8    /* an invalid receiver mode was specified */
  79. #define    NO_SPACE    9    /* operation failed because of insufficient space */
  80. #define    TYPE_INUSE    10    /* the type had previously been accessed, and not released */
  81. #define    BAD_COMMAND    11    /* the command was out of range, or not    implemented */
  82. #define    CANT_SEND    12    /* the packet couldn't be sent (usually    hardware error) */
  83. #define CANT_SET    13    /* hardware address couldn't be changed (> 1 handle open) */
  84. #define BAD_ADDRESS    14    /* hardware address has bad length or format */
  85. #define CANT_RESET    15    /* couldn't reset interface (> 1 handle open) */
  86.  
  87. #define    CARRY_FLAG    0x1
  88.  
  89. struct pktdrvr {
  90.     int class;    /* Interface class (ether/slip/etc) */
  91.     int intno;    /* Interrupt vector */
  92.     short handle;    /* Driver handle */
  93.     struct mbuf *buffer;    /* Currently allocated rx buffer */
  94.     struct iface *iface;
  95.     _go32_dpmi_seginfo rmcb_seginfo;
  96.     _go32_dpmi_registers rmcb_registers;
  97.     int32 dosbase;
  98.     int32 dossize;
  99.     int32 wptr;    /* write pointer into DOS buffer */
  100.     int32 rptr;    /* read pointer into DOS buffer */
  101.     int32 cnt;    /* Count of unread bytes in buffer */
  102.     int32 overflows;
  103. };
  104.  
  105.  
  106. /* In pktdrvr.c: */
  107. int pk_send(struct mbuf *bp,struct iface *iface,uint32 gateway,int prec,int del,int tput,int rel);
  108.  
  109. #endif    /* MSDOS */
  110.  
  111. #endif    /* _PKTDRVR_H */
  112.